﻿using Microsoft.Practices.ServiceLocation;
using CodeSaude.Application.Interfaces;
using CodeSaude.Infrastructure.Data.Interfaces;

namespace CodeSaude.Application.Services
{
    public class BaseApplicationService : IBaseApplicationService
    {
        private IUnitOfWork _uow;

        public virtual void BeginTransaction()
        {
            _uow = ServiceLocator.Current.GetInstance<IUnitOfWork>();
            _uow.BeginTransaction();
        }

        public virtual void Commit()
        {
            _uow.SaveChanges();
        }
    }
}
